package com.csw.data.utils.entity;

import com.csw.data.annotation.Id;
import com.csw.data.annotation.ManyToOne;
import com.csw.data.annotation.OneToMany;
import com.csw.data.annotation.Table;
import lombok.Data;

import java.util.List;

/**
 * @Author ChenSW
 * @Date 2016/12/24 11:31
 */
@Data
@Table("tb_person")
public class Person {

    @Id
    private String id;
    private String name;
    private Integer age;
    private String address;

    @OneToMany(cls = Person.class)
    private List<Person> sons;

    @ManyToOne(column = "parent_id")
    private Person parent;

}
